/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package toesp.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author satria.sp
 */
@Entity
@Table(name = "grouppermission")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Grouppermission.findAll", query = "SELECT g FROM Grouppermission g")})
public class Grouppermission implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "group_id")
    private Integer groupId;
    @Column(name = "group_name")
    private String groupName;
    @OneToMany(mappedBy = "grouppermission")
    private List<Groupmenu> groupmenuList;
    @OneToMany(mappedBy = "grouppermission")
    private List<Groupuser> groupuserList;

    public Grouppermission() {
    }

    public Grouppermission(Integer groupId) {
        this.groupId = groupId;
    }

    public Integer getGroupId() {
        return groupId;
    }

    public void setGroupId(Integer groupId) {
        this.groupId = groupId;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    @XmlTransient
    public List<Groupmenu> getGroupmenuList() {
        return groupmenuList;
    }

    public void setGroupmenuList(List<Groupmenu> groupmenuList) {
        this.groupmenuList = groupmenuList;
    }

    @XmlTransient
    public List<Groupuser> getGroupuserList() {
        return groupuserList;
    }

    public void setGroupuserList(List<Groupuser> groupuserList) {
        this.groupuserList = groupuserList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (groupId != null ? groupId.hashCode() : 0);
        return hash;
    } 
    
}
